<extend name="Public/base" />

<block name="body">
	<div class="am-cf am-u-md-12 header-title">
		<h2><if condition="ACTION_NAME eq 'addaction'">新增<else/>编辑</if>行为</h2>
	</div>
	<div class="am-cf am-u-md-12 am-margin-top">
		<!-- 表单 -->
		<form id="form" action="{:U('saveAction')}" method="post" class="am-form am-form-horizontal">
			<div class="am-form-group">
				<label class="am-u-sm-2 am-form-label">行为标识</label>
				<div class="am-u-sm-10">
					<input type="text" class="text input-large" name="name" value="{$data.name}">
					<span class="am-form-help">（输入行为标识 英文字母）</span>
				</div>
			</div>
			<div class="am-form-group">
				<label class="am-u-sm-2 am-form-label">行为名称</label>
				<div class="am-u-sm-10">
					<input type="text" class="text input-large" name="title" value="{$data.title}">
					<span class="am-form-help">（输入行为名称）</span>
				</div>
			</div>
			<div class="am-form-group">
				<label class="am-u-sm-2 am-form-label">行为类型</label>
				<div class="am-u-sm-10">
					<select name="type">
						<volist name=":get_action_type(null,true)" id="vo">
							<option value="{$key}">{$vo}</option>
						</volist>
					</select>
					<span class="am-form-help">（选择行为类型）</span>
				</div>
			</div>
			<div class="am-form-group">
				<label class="am-u-sm-2 am-form-label">行为描述</label>
				<div class="am-u-sm-10">
					<textarea name="remark">{$data.remark}</textarea>
					<span class="am-form-help">（输入行为描述）</span>
				</div>
			</div>
			<div class="am-form-group">
				<label class="am-u-sm-2 am-form-label">行为规则</label>
				<div class="am-u-sm-10">
					<textarea name="rule">{$data.rule}</textarea>
					<span class="am-form-help">（输入行为规则，不写则只记录日志）</span>
				</div>
			</div>
			<div class="am-form-group">
				<label class="am-u-sm-2 am-form-label">日志规则</label>
				<div class="am-u-sm-10">
					<textarea name="log">{$data.log}</textarea>
					<span class="am-form-help">（记录日志备注时按此规则来生成，支持[变量|函数]。目前变量有：user,time,model,record,data）</span>
				</div>
			</div>

			<div class="am-form-group">
	            <div class="am-u-sm-10 am-u-sm-offset-2">
					<input type="hidden" name="id" value="{$data.id}"/>
					<button type="submit" class="am-btn am-btn-primary submit-btn ajax-post" target-form="am-form-horizontal">确 定</button>
					<button class="am-btn am-btn-default btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
				</div>
			</div>
		</form>
	</div>
</block>

<block name="script">
<script type="text/javascript" src="__PUBLIC__/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" charset="utf-8">
	Think.setValue('type',{$type|default=1});
    //导航高亮
    highlight_subnav('{:U('User/action')}');
</script>
</block>
